<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box1{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
			color: #fff;
		}

		.box2{
			width: 200px;
			height: 200px;
			background: blue url() 0 0 no-repeat;
			color: #fff;
		}
		.son{
			width: 50px;
			height: 50px;
			background: #fff url() 0 0 no-repeat;
		}


	</style>
	<script type="text/javascript">
		window.onload = function (){
			box1 = document.getElementById('box1');

			box2 = document.getElementById('box2');

			box1.onclick = function  () {
				box1.innerHTML = box2.innerHTML;
				 box2.innerHTML='';
			}

			box2.onclick = function  () {
				box2.innerHTML = box1.innerHTML;
				 box1.innerHTML='';
			}


			box2.onmouseover = function  () {
				box2.style.width="300px";
				box2.style.height="300px";
			}

			box2.onmouseout = function  () {
				box2.style.width="200px";
				box2.style.height="200px";
			}

			btn = document.getElementById("btn");

			btn.onclick = function  () {
				res = confirm("你是否要删除");

				if(res){
					box1.style.display="none";
					box2.style.display="none";
				}
			}







		}

	</script>
</head> 
<body>
	<input type="button" id="btn" value="点我吧">
	<div id="box1" class="box1"><div class="son"></div></div>
	<div id="box2" class="box2"></div>
</body>
</html>